package com.baizhi.service.impl;

import com.baizhi.dao.FoodDao;
import com.baizhi.entity.Food;
import com.baizhi.service.FoodService;

import java.util.List;

public class FoodServiceImpl implements FoodService {
    private FoodDao foodDao;
    public void setFoodDao(FoodDao foodDao) {
        this.foodDao = foodDao;
    }

    @Override
    public List<Food> selectFoods(Integer pageNum, Integer pageSize) {
        List<Food> foods = foodDao.selectFoods(pageNum, pageSize);
        return foods;
    }

    @Override
    public Food selectFoodById(Integer id) {
        Food food = foodDao.selectFoodById(id);
        return food;
    }

    @Override
    public void insertFood(Food f) {
        foodDao.insertFood(f);
    }
    @Override
    public void deleteFoodById(Integer id) {
        foodDao.deleteFoodById(id);
    }

    @Override
    public void updateFood(Food f) {
        foodDao.updateFood(f);
    }
}
